module manager {

    export class ResManager {

        public static getBitmap(name: string): egret.Bitmap {
            if (!RES.hasRes(name)) {
                egret.log(name + "资源不存在");
            }
            let result = new egret.Bitmap();
            const texture: egret.Texture = RES.getRes(name);
            result.texture = texture;
            return result;
        }

        public static getTexture(name: string): egret.Texture {
            return RES.getRes(name);
        }

        public static getRes(key: string): any {
            return RES.getRes(key);
        }


        public static getTextures(prefix: string, start: number, end: number): Array<egret.Texture> {
            let textures: Array<egret.Texture> = [];
            for (let i: number = start; i <= end; i++) {
                textures.push(RES.getRes(prefix + i));
            }
            return textures;
        }

    }
}